package com.huifaapp.mall.bean;

import android.util.Log;

import org.json.JSONException;
import org.json.JSONObject;

/**
 * Created by Administrator on 2018/1/12.
 */

public class UsersAddrVoBean {
    public static class Attr {
        public static final String RECEIVERNAME = "receiverName";
        public static final String RECEIVERPHONE = "receiverPhone";
        public static final String DETAIL="detail";
        public static final String ID="id";



    }
    public UsersAddrVoBean() {

    }

    public UsersAddrVoBean(String receiverName,String receiverPhone,String detail,String id){
        super();
        this.receiverName=receiverName;
        this.receiverPhone=receiverPhone;
        this.detail=detail;
        this.id=id;

    }
    /**
     * receiverName : 黎明
     * receiverPhone : 15100012231
     * detail : 小区8号楼909
     * id : 977b3e2c48024a30bb0819b7259e063b
     */

    private String receiverName;
    private String receiverPhone;
    private String detail;
    private String id;


    public static UsersAddrVoBean newInstanceDetails(String json) {
        UsersAddrVoBean bean = null;
        try {
            JSONObject obj = new JSONObject(json);
            if (obj.length() > 0) {
                Log.e("tag", obj+"");

                String receiverName=obj.getString(Attr.RECEIVERNAME);
                String receiverPhone=obj.getString(Attr.RECEIVERPHONE);
                String detail=obj.getString(Attr.DETAIL);
                String id=obj.getString(Attr.ID);


                bean = new UsersAddrVoBean(receiverName,receiverPhone,detail,id);
            }
        } catch (JSONException e) {
            e.printStackTrace();
        }
        return bean;
    }
    public String getReceiverName() {
        return receiverName;
    }

    public void setReceiverName(String receiverName) {
        this.receiverName = receiverName;
    }

    public String getReceiverPhone() {
        return receiverPhone;
    }

    public void setReceiverPhone(String receiverPhone) {
        this.receiverPhone = receiverPhone;
    }

    public String getDetail() {
        return detail;
    }

    public void setDetail(String detail) {
        this.detail = detail;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }
}
